﻿namespace LunchLearn.WebApi.Domain
{
    public class OrderLine
    {
        public int Id { get; set; }
        public int OrderId { get; set; }
        public int Quantity { get; set; }
        public int ItemId { get; set; }
        public string ItemName
        {
            get
            {
                return Item != null ? Item.ItemCode : string.Empty;
            }
        }

        public virtual Item Item { get; set; }

        public virtual Order Order { get; set; }

        public float TotalAmount
        {
            get
            {
                return Item != null ? Item.Price * Quantity : 0;
            }
        }
    }
}
